<html>
<head>
    <script src="/js/validate.js" type="text/javascript"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body style="background-color: transparent">
<form id="id-form" name="frm" method="post" action="" enctype="multipart/form-data">
	<input type="hidden" name="STOREID" id="STOREID" value="<?=(isset($this->data)?$this->data->STOREID:'')?>" />
	<table>
        <tr>
        	<td class="popup-label">
				Owner Email
        	</td>
        	<td>
				<input class="popup-input" id="EMAIL" name="EMAIL" value="<?=(isset($this->data)?$this->data->EMAIL:'')?>" type="text"  size="30"/>
        	</td>
        </tr>
        
		<br/>
   	</table>    
</form>
<script language="text/javascript">
    function save(){
		$('#change-owner-dialog').dialog('close');
		var email = $('#EMAIL').val();
		var id = $('#STOREID').val();
		$.ajax({
			url: "/admin/store/changeownersave",
			type: "POST",
			data: {STOREID: id, EMAIL: email},
			dataType: "text",
			success: function(result) {
				var text = $.trim(result);
				if(text.indexOf('successful') >=0 ){
					$('#EMAIL' + id).html(email);
				} else {
					alert("You have an error: " + text);
				}
			}
		});
    }	
</script>
</body>
</html>